package com.app.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;

import com.app.core.ReturnVoCommon;
import com.pro.model.User;
import com.pro.util.ResponseUtil;

import net.sf.json.JSONObject;

@Controller
public class BaseController {

	protected User loginUser;
	
	protected ReturnVoCommon result = new ReturnVoCommon();
	
	public void init(HttpServletRequest request){
		HttpSession session = request.getSession();
		result = new ReturnVoCommon();
		loginUser = (User) session.getAttribute("currentUser");
	}
	
	public void endProcess(HttpServletResponse response,Object o){
		ResponseUtil.write(response, JSONObject.fromObject(o));
	}
	
}
